<?php

namespace app\controller\api\common;


use crmeb\basic\BaseController;
use think\App;
use app\common\repositories\system\common\ProblemRepository as repository;


class Problem extends BaseController
{
    /**
     * @var repository
     */
    protected $repository;
    protected $user;

    /**
     * User constructor.
     * @param App $app
     * @param  $repository
     */
    public function __construct(App $app, repository $repository)
    {
        parent::__construct($app);
        $this->repository = $repository;
    }

    /**
     * TODO 常见问题列表
     * @return \think\response\Json
     * @author fupeng
     * @day 2023/10/8
     */
    public function lst()
    {
        $where = $this->request->params(['type']);
        $where['is_show'] = 1;
        [$page, $limit] = $this->getPage();
        return app('json')->success($this->repository->getApiList($where, $page, $limit,'sort desc','title,content,create_time'));
    }





}
